# -*- coding: latin-1 -*-
import re
class validacion:
    def __init__(self):
        pass
   
    def esMoneda(self, texto):
        re_float = re.compile("""(?x)
        ^
        [+-]?\ *      # first, match an optional sign *and space*
        (             # then match integers or f.p. mantissas:
            \d+       # start out with a ...
            (
                \.\d* # mantissa of the form a.b or a.
            )?        # ? takes care of integers of the form a
            |\.\d+     # mantissa of the form .b
        )
        ([eE][+-]?\d+)?  # finally, optionally match an exponent
        $""")
        return re_float.match(str(texto))
        
    def esTemperatura(self, texto):
        re_float = re.compile("""(?x)
        ^
        [+-]?\ *      # first, match an optional sign *and space*
        (             # then match integers or f.p. mantissas:
            \d+       # start out with a ...
            (
                \.\d* # mantissa of the form a.b or a.
            )?        # ? takes care of integers of the form a
            |\.\d+     # mantissa of the form .b
        )
        ([eE][+-]?\d+)?  # finally, optionally match an exponent
        $""")
        return re_float.match(str(texto))       
